#
# Be sure to run `pod lib lint SQToolsLibrary.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#pod lib lint --sources='http://git.17gwx.com/iOS_lib/Lib.git,http://git.17gwx.com/iOS/SQSpecs.git,https://gitee.com/sqkb-ios/sqspecs.git' --allow-warnings

Pod::Spec.new do |s|
  s.name             = 'SQToolsLibrary'
  s.version          = '0.1.4'
  s.summary          = 'A description of SQToolsLibrary.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long long description of the pod here.
                       DESC

  s.homepage         = 'http://git.17gwx.com/iOS_lib/SQToolsLibrary'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'laohei' => 'laohei@ibantang.com' }
  s.source           = { :git => 'http://git.17gwx.com/iOS_lib/SQToolsLibrary.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '9.0'

  s.source_files = 'SQToolsLibrary/Classes/OutSetHeader/**/*'
   s.subspec 'Foundation' do |foundation|
    foundation.source_files = 'SQToolsLibrary/Classes/Foundation/**/*'
  end
   
   s.subspec 'Mediator' do |mediator|
       mediator.source_files = 'SQToolsLibrary/Classes/Mediator/**/*'
   end
   
   s.subspec 'Macro' do |macro|
     macro.source_files = 'SQToolsLibrary/Classes/Macro/**/*'
     macro.dependency  'SQToolsLibrary/Mediator'
   end
   
   s.subspec 'Tools' do |tools|
     tools.exclude_files = 'SQToolsLibrary/Classes/Tools/OpenUDID/*'
     tools.source_files = 'SQToolsLibrary/Classes/Tools/**/*'
     tools.dependency  'MMKV'
     tools.dependency  'libextobjc'
     tools.ios.dependency 'SQToolsLibrary/Macro'
     tools.ios.dependency 'SQToolsLibrary/Foundation'
   end
   
   s.subspec 'DebugLog' do |debugtool|
     debugtool.source_files = 'SQToolsLibrary/Classes/debugLog/**/*'
     debugtool.ios.dependency 'SQLog'
     debugtool.ios.dependency 'CocoaLumberjack'
   end
   
   s.subspec 'AppConfig' do |appConfig|
     appConfig.source_files = 'SQToolsLibrary/Classes/AppConfig/**/*'
     appConfig.ios.dependency 'SQToolsLibrary/Macro'
     appConfig.ios.dependency 'SQToolsLibrary/Tools'
     appConfig.ios.dependency 'SQToolsLibrary/OpenUDID'
     appConfig.ios.dependency 'SQToolsLibrary/Mediator'
   end
   
   s.subspec 'OpenUDID' do |openUDID|
     openUDID.requires_arc = false
     openUDID.source_files = 'SQToolsLibrary/Classes/Tools/OpenUDID/*'
   end
   
   s.subspec 'UI' do |ui|
     
       ui.subspec 'UIKit' do |kit|
         kit.source_files = 'SQToolsLibrary/Classes/UI/UIKit/**/*'
         kit.ios.dependency 'MBProgressHUD'
         kit.ios.dependency 'SQToolsLibrary/Macro'
       end
       
       ui.subspec 'ThirdUI' do |third|
          third.ios.dependency 'SQToolsLibrary/Macro'
          third.subspec 'CellSubView' do |cell|
            cell.source_files = 'SQToolsLibrary/Classes/UI/ThirdUI/CellSubView/**/*'
            cell.ios.dependency 'SQToolsLibrary/UI/UIKit'
            cell.ios.dependency 'SQToolsLibrary/Macro'
            cell.ios.dependency 'SQToolsLibrary/UI/ThirdUI/UICustomizedViews'
          end
          
          third.subspec 'SDWebImage' do |sd|
            sd.source_files = 'SQToolsLibrary/Classes/UI/ThirdUI/SDWebImage/**/*'
            sd.ios.dependency 'SDWebImage'
            sd.ios.dependency 'FLAnimatedImage'
          end
          
          third.subspec 'UI3rdParty' do |part|
            part.source_files = 'SQToolsLibrary/Classes/UI/ThirdUI/UI3rdParty/**/*'
          end
          
          third.subspec 'UICustomizedViews' do |custom|
            custom.source_files = 'SQToolsLibrary/Classes/UI/ThirdUI/UICustomizedViews/**/*'
            custom.ios.dependency 'SQToolsLibrary/UI/UIKit'
          end
          
          third.subspec 'ZFPlayer' do |zf|
            zf.source_files = 'SQToolsLibrary/Classes/UI/ThirdUI/ZFPlayer/**/*.{h,m}'
            zf.resources = 'SQToolsLibrary/Classes/UI/ThirdUI/ZFPlayer/**/*.bundle'
          end
       end
   end
   

  # s.resource_bundles = {
  #   'SQToolsLibrary' => ['SQToolsLibrary/Assets/*.png']
  # }

  s.frameworks = 'Foundation','AdSupport','CoreTelephony','UIKit'
  s.dependency 'Reachability'
  s.dependency 'Masonry'
  s.dependency 'libextobjc'
  s.prefix_header_contents = '#import <UIKit/UIKit.h>','#import <libextobjc/EXTScope.h>','#import <Masonry/Masonry.h>'
  
  
  if ENV['push'] == "1"
      puts '-----------------------提交本地pod---------------------------------------'
      dev_url = "./"+s.name
      puts Dir.pwd
      system 'git add .'
      system "git commit -m 'pod 提交'"
      system 'git push origin master'
      puts '--------------------------结束-----------------------------------------'
  end
  
end
